<template>
  <el-select placeholder="请选择" v-model="form.channel_id">
    <el-option
      v-for="item in channelsList"
      :key="item.id"
      :label="item.name"
      :value="item.id"
    ></el-option>
  </el-select>
</template>
<script>
import { channels } from '@/api/index.js'
export default {
  name: 'HmSelect',
  props: ['form'],
  data () {
    return {
      channelsList: [],
      selectValue: ''
    }
  },
  //   watch: {
  //     selectValue: {
  //       handler (newVal) {
  //         this.$emit('input', newVal)
  //       }
  //     }
  //   },
  async created () {
    const res = await channels() // axios请求  异步  ajax请求  promise.then 微任务
    this.channelsList = res.data.channels
  }
}
</script>
<style></style>
